The present invention relates to an image coding device for coding an image signal for use with a color facsimile apparatus or the like, and also relates to an image decoding device for decoding an image coded by such an image coding device.
In a color facsimile apparatus, for example, coding is generally carried out to reduce the quantity of data of a color image.
As a color still picture coding method of various image coding methods is known a JPEG coding method that has been considered on international standardization in JPEG (Joint Photographic Expert Group), a joint of ISO and CCITT.
In the JPEG coding method, an input image is subjected to discrete cosine transformation, quantization, and entropy coding, and compressed data is output. In the case of the color facsimile apparatus, a coding method for a character/photograph mixed document is important. However, when a compression ratio of image data is large in this coding method, quantization error or truncation of a high-frequency component of a spatial frequency of the image causes a deterioration in quality of a character or line image decoded.
To cope with this problem, there have been proposed various image coding methods using a binary image coding method as an information retention type in combination with the JPEG coding method (e.g., Katzuno et al.; "Proposal on High-efficiency Hybrid Coding Method for Color Facsimile"; Electronic Information Communication Society Technical Report CS 91-96, 1991).
FIG. 16 shows an image coding device using this method. In FIG. 16, reference numeral 201 denotes an input image signal. 202 denotes a blocking circuit for dividing the input image signal 201 into a plurality of blocks. 204 denotes a coding mode deciding circuit for deciding a coding method for the input image signal 201. 209 denotes a character/background separating circuit for separating the input image signal 201 into a binary image and a nonbinary image. 2010 denotes a JBIG coder for coding the binary image by a JBIG coding method that has been considered on internal standardization in JBIG (Joint Bi-level Image Expert Group) as a joint of ISO and CCITT. 2011 denotes a JPEG coder for coding the nonbinary image by the JPEG coding method mentioned above. 2015 denotes a decision result obtained in the coding mode deciding circuit 204. 2017 denotes image density information obtained in the character/background separating circuit 209. 2018 denotes a coded result obtained in the JBIG coder 2010. 2019 denotes a coded result obtained in the JPEG coder 2011.
The operation of the image coding device shown in FIG. 16 will now be described. The input image signal 201 is input into the blocking circuit 202. In the blocking circuit 202, the image signal 201 is divided into a plurality of blocks each having (m x n) pixels, e.g., (8.times.8) pixels. Then, each block is fed to the coding mode deciding circuit 204.
In the coding mode deciding circuit 204, it is decided whether the image block is an area including a character or line graphic (which area will be hereinafter referred to as a character area) or an area excluding a character or line graphic (which area will be hereinafter referred to as a photographic area). More specifically, in the coding mode deciding circuit 204, the maximum S.sub.max and the minimum S.sub.min of pixel values of (8.times.8) pixels in each block are examined, and the difference between the maximum S.sub.max and the minimum S.sub.min is compared with a predetermined value T.sub.1. If S.sub.max -S.sub.min .gtoreq.T.sub.1, the image block is decided as the character area, while if S.sub.max -S.sub.min &lt;T.sub.1, the image block is decided as the photographic area.
Alternatively, as shown in FIG. 17, in the coding mode deciding circuit 204, the distribution of pixel values of (8.times.8) pixels in each block is examined, wherein the number of peaks P in this distribution is checked and the difference between the maximum S.sub.max and the minimum S.sub.min is compared with appropriate values T.sub.2 and T.sub.3. If T.sub.3 &lt;S.sub.max -S.sub.min, the image block is decided as the character area. If (T.sub.2 &lt;S.sub.max -S.sub.min .ltoreq.T.sub.3) and (P=1 or P-2), the image block is decided as the character area. If (T.sub.2 &lt;S.sub.max -S.sub.min .ltoreq.T.sub.3) and (P.noteq.1 and P.noteq.2), the image block is decided as the photographic area. If S.sub.max -S.sub.min .ltoreq.T.sub.2, the image block is decided as the photographic area.
Further, the decision result 2015 is output from the coding mode deciding circuit 204. The number of peaks P in the distribution is obtained by an algorithm as shown in FIG. 18, for example.
The image block decided as the character area in the coding mode deciding circuit 204 is fed to the character/background separating circuit 209. In the character/background separating circuit 209, the following operation is carried out as shown in FIG. 19.
As shown in FIG. 4, a pixel value at a position (i, j) in the image block is denoted by S.sub.ij. Then, the average M of the pixel values in the image block is obtained. Then, a binary image B.sub.ij having a value 0 or 1 in the image block is created. That is, the pixel value S.sub.ij is compared with the average M to decide the value of the binary image B.sub.ij as follows: EQU If S.sub.ij .gtoreq.M, B.sub.ij =1 EQU If S.sub.ij &lt;M, B.sub.ij =0
The binary image B.sub.ij thus obtained is fed to the JBIG coder 2010.
Then, image density information S.sub.high and S.sub.low are created. That is, the image density information S.sub.high is obtained by averaging the pixel values of the pixels satisfying S.sub.ij .gtoreq.M. On the other hand, the image density information S.sub.low is obtained by averaging the pixel values of the pixels satisfying S.sub.ij &lt;M. This density information is output as 2017 shown in FIG. 16.
Then, a difference image C.sub.ij is created. That is, the difference image C.sub.ij is obtained according to the binary image B.sub.ij as follows: EQU If B.sub.ij =1, C.sub.ij =S.sub.ij -S.sub.high +U EQU If B.sub.ij =0, C.sub.ij =S.sub.ij -S.sub.low +U
where U represents an obtainable intermediate value of the pixel values of the subject image. In the case where an original image is an edge image containing a low-frequency component as shown in FIG. 20A, the difference image as shown in FIG. 20B is obtained.
Alternatively, the difference image C.sub.ij may be created as follows: EQU If B.sub.ij =0, C.sub.ij =S.sub.low -S.sub.ij +U
In this case, a difference image as shown in FIG. 20C is obtained from the original image shown in FIG. 20A.
This difference image C.sub.ij is fed to the JPEG coder 2011, and is coded in the JPEG coder 2011. Then, the code 2019 is output from the JPEG coder 2011.
The binary image B.sub.ij from the circuit 209 is coded in the JBIG coder 2010, and the code 2018 is output therefrom.
The image block decided as the photographic area in the coding mode deciding circuit 204 is coded in the JPEG coder 2011, and the code 2019 is output therefrom.
In the image coding device shown in FIG. 16, the decision result 2015, the density information 2017, the JBIG coded result 2018, and the JPEG coded result 2019 are assembled to generate a final code. Alternatively, the decision result 2015 and the JPEG coded result 2019 are assembled to generate a final code.
The above coding method in the prior art has the following problems.
(1) Even when the image block is a completely binary image or an image hardly deteriorated in image quality after converted into a completely binary image (which image will be hereinafter referred to as a semi-binary image), coding is necessary in both the JPEG coding method and the JBIG coding method. As a result, a redundant number of bits for coding is required.
(2) When a character image or a line image containing a low-frequency component as shown in FIG. 20A is input, a small change is generated in the difference image (see FIG. 20B or FIG. 20C) left by subtraction of the binary image from the original image (see FIG. 20A), that is, a high-frequency component in a spatial frequency of the image is generated. As a result, an image quality is deteriorated rather more as compared with the case where the image is coded by the JPEG coding method only.